]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
parentalControlsManager: Be less verbose on the logs
authorJonas Dreßler <verdre@v0yd.nl>
Fri, 18 Feb 2022 13:13:59 +0000 (14:13 +0100)
committerMarge Bot <marge-bot@gnome.org>
Fri, 18 Feb 2022 22:05:16 +0000 (22:05 +0000)
There's a few things that are really unncessary to log without any
debugging enabled, for example "Getting parental controls for user", so
remove that.

Other things can be useful, so use console.debug() to log those.

Especially the warning in showAppInfo() we don't want log by default as
it spills tons of messages during shell startup (the async
initialization of the malcontent manager takes some time).

While at it, also make the !HAVE_MALCONTENT message a bit more accurate.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2196>

js/misc/parentalControlsManager.js

index 092721133aa4ee0f811f08e6abb81578a1e59831..e2192caea6b03e6f88a6edecd76a7a65c97cc925 100644 (file)
@@ -65,13 +65,12 @@ var ParentalControlsManager = GObject.registerClass({
 
     async _initializeManager() {
         if (!HAVE_MALCONTENT) {
-            log('Skipping parental controls support as it’s disabled');
+            console.debug('Skipping parental controls support, malcontent not found');
             this._initialized = true;
             this.emit('app-filter-changed');
             return;
         }
 
-        log(`Getting parental controls for user ${Shell.util_get_uid()}`);
         try {
             const connection = await Gio.DBus.get(Gio.BusType.SYSTEM, null);
             this._manager = new Malcontent.Manager({ connection });
@@ -81,7 +80,7 @@ var ParentalControlsManager = GObject.registerClass({
                 null);
         } catch (e) {
             if (e.matches(Malcontent.ManagerError, Malcontent.ManagerError.DISABLED)) {
-                log('Parental controls globally disabled');
+                console.debug('Parental controls globally disabled');
                 this._disabled = true;
             } else {
                 logError(e, 'Failed to get parental controls settings');
@@ -137,7 +136,7 @@ var ParentalControlsManager = GObject.registerClass({
 
         // Have we finished initialising yet?
         if (!this.initialized) {
-            log(`Warning: Hiding app because parental controls not yet initialised: ${appInfo.get_id()}`);
+            console.debug(`Hiding app because parental controls not yet initialised: ${appInfo.get_id()}`);
             return false;
         }